package com.soyea.vo;

import lombok.Getter;

/**
 * 中奖状态 枚举
 * Created by skh on 2018/1/19
 */
@Getter
public enum  PrizeEnum {
	NO_PRIZE(0,"未中奖"),
	FIRST_PRIZE(1,"一等奖"),
	SECOND_PRIZE(2,"二等奖"),
	THIRD_PRIZE(3,"三等奖"),
	MEMORIAL_PRIZE(4,"纪念奖"),
	TOP_PRIZE(5,"特等奖")
	;

	private Integer code;
	private String message;

	PrizeEnum(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	public static PrizeEnum stateOf(Integer index) {
		for (PrizeEnum state : values()) {
			if (state.getCode() == index) {
				return state;
			}
		}
		return null;
	}
}
